package com.ynny.chapter04.dao;

import com.ynny.chapter04.base.BaseDAO;
import com.ynny.chapter04.entity.User;

public class UserDaoImpl extends BaseDAO<User> implements UserDao {
    @Override
    public User selectUserByUserNameAndPassword(String userName, String password) {
        String sql = "select * from user where userName=? and password=?";
        User user = selectOne(sql, userName, password);
        return user;
    }

    @Override
    public User selectUserByUserName(String userName) {

        String sql = "select * from user where userName=?";
        User user = selectOne(sql, userName);
        return user;
    }
}
